package org.deschutter.hibernate;

import javax.persistence.*;
import java.util.Collection;
import java.math.BigDecimal;

/**
 * User: Berten De Schutter
 * Date: 01-Oct-2009
 * Time: 13:38:46
 */
@Entity
@Table(catalog = "scimitar", name = "jumpgate_probe_type")
public class JumpgateProbeType {
    private BigDecimal id;

    @Id
    @Column(name = "ID")
    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    private String name;

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        JumpgateProbeType that = (JumpgateProbeType) o;

        if (id != that.id) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id.intValue();
        result = 31 * result + (name != null ? name.hashCode() : 0);
        return result;
    }

    private Collection<Jumpgate> jumpgatesById;

    @OneToMany(mappedBy = "jumpgateProbeTypeByTypeId")
    public Collection<Jumpgate> getJumpgatesById() {
        return jumpgatesById;
    }

    public void setJumpgatesById(Collection<Jumpgate> jumpgatesById) {
        this.jumpgatesById = jumpgatesById;
    }
}
